import 'package:flutter/widgets.dart';
import 'package:pp_uikit/date_picker/pp_base_picker.dart';
import 'package:pp_uikit/date_picker/pp_date_picker.dart';

class PPTimePicker {
  static void show(
    BuildContext context, {
    /// 点击弹框外部区域能否消失
    bool? canBarrierDismissible,

    /// 能滚动到的最小日期
    DateTime? minDateTime,

    /// 能滚动到的最大日期
    DateTime? maxDateTime,

    /// 初始选择的时间。默认当前时间
    DateTime? initialDateTime,

    /// 时间格式化的格式
    String? dateFormat,

    /// 分钟间切换的差值
    int minuteDivider = 1,

    /// 点击【取消】回调给调用方的回调事件
    DateVoidCallback? onCancel,

    /// 点击【完成】回调给调用方的数据
    DateVoidCallback? onClose,

    /// 时间滚动选择时候的回调事件
    DateValueCallback? onChange,

    /// 弹框点击外围消失的回调事件
    DateValueCallback? onConfirm,

    /// 主题色
    Color? themeColor,
  }) {
    PPDatePicker.show(
      context,
      canBarrierDismissible: canBarrierDismissible,
      minDateTime: minDateTime,
      maxDateTime: maxDateTime,
      initialDateTime: initialDateTime,
      dateFormat: dateFormat,
      minuteDivider: minuteDivider,
      themeColor: themeColor,
      pickerMode: PPDateTimePickerMode.time,
      onCancel: onCancel,
      onClose: onClose,
      onChange: onChange,
      onConfirm: onConfirm,
    );
  }
}
